Image segmentation system

ABSTRACT

An image segmentation system to perform operations that include causing display of an image within a graphical user interface of a client device, receive a set of user inputs that identify portions of a background and foreground of the image, identify a boundary of an object depicted within the image based on the set of user inputs, crop the object from the image based on the boundary, and generate a media item based on the cropped object, wherein properties of the media object, such as a size and a shape, are based on the boundary of the object.

CLAIM OF PRIORITY

This application is a continuation of U.S. Pat. App. Serial No.17/249,445, filed Mar. 2, 2021, which application is a continuation ofU.S. Pat. App. Serial No. 16/365,228, filed on Mar. 26, 2019, now issuedas U.S. Pat. No. 10,964,023, which are incorporated herein by referencein their entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate generally to mobilecomputing technology and, more particularly, but not by way oflimitation, to systems for performing image segmentation upon an image aclient device.

BACKGROUND

Various multimedia editing tools to enable users to select objects orlayers in images are among the most useful and widely used toolsavailable for editors. Such applications generally require users toprovide multiple, often painstakingly precise and detailed, inputs todefine a border of an object within an image. As a result, such toolsare not particularly user friendly for beginners, or users that may beoperating devices with limited display screens.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

To easily identify the discussion of any particular element or act, themost significant digit or digits in a reference number refer to thefigure number in which that element is first introduced.

FIG. 1 is a block diagram showing an example messaging system forexchanging data (e.g., messages and associated content) over a networkin accordance with some embodiments, wherein the messaging systemincludes a contextual filter system.

FIG. 2 is block diagram illustrating further details regarding amessaging system, according to example embodiments.

FIG. 3 is a block diagram illustrating various modules of a contextualfilter system, according to certain example embodiments.

FIG. 4 is a flowchart depicting a method of segmenting an object from animage, according to certain example embodiments.

FIG. 5 is a flowchart depicting a method of segmenting an object from animage, according to certain example embodiments.

FIG. 6 is a flowchart depicting a method of generating media content,according to certain example embodiments.

FIG. 7 is a flow-diagram depicting a method to segment an object from animage, according to certain example embodiments.

FIG. 8 is a flow-diagram depicting a method of generating media content,according to certain example embodiments.

FIG. 9 is a block diagram illustrating a representative softwarearchitecture, which may be used in conjunction with various hardwarearchitectures herein described and used to implement variousembodiments.

FIG. 10 is a block diagram illustrating components of a machine,according to some example embodiments, able to read instructions from amachine-readable medium (e.g., a machine-readable storage medium) andperform any one or more of the methodologies discussed herein.

DETAILED DESCRIPTION

As discussed above, various multimedia editing tools to enable users toselect objects or layers in images generally require users to provideprecise and detailed inputs to select and segment objects from images.Due to the precision and skill required to accurately segment objectsfrom images, these tools are inefficient and time consuming to use forbeginners and users executing the multimedia tools through limitedhardware, such as a touch screen of a mobile device. A system to enableusers to accurately segment objects from images with fewer inputs wouldtherefore be an improvement over existing technology.

Example embodiments described herein relate to an image segmentationsystem to segment objects from images based on simple user inputs.According to certain embodiments, the image segmentation system isconfigured to perform operations that include causing display of animage within a graphical user interface of a client device, receive aset of user inputs that identify portions of a background and foregroundof the image, identify a boundary of an object depicted within the imagebased on the set of user inputs, crop the object from the image based onthe boundary, and generate a media item based on the cropped object,wherein properties of the media object, such as a size and a shape, arebased on the boundary of the object.

In some example embodiments, the user inputs that identify regions ofthe background and foreground of the image may include a first userinput that identifies a region of the image within the foregroundportion of the image and a second user input that identifies a region ofthe image within the background portion of the image. For example, theuser inputs may include inputs that identify a set of pixels located inthe background or foreground portions of the image. In such embodiments,the user input may include a stroke, or scribble, that draws a line likea brush stroke over a set of pixels within either the foreground orbackground portion of the image. For example, a user may provide aninput selecting either a foreground stroke, or a background stroke,wherein the foreground stroke identifies the foreground portion of theimage and the background stroke identified the background portion of theimage.

In some embodiments, responsive to receiving the user inputs, the imagesegmentation system generates and causes display of a visualrepresentation of the user input upon the image. For example, the userinput may be represented visually as a stroke of paint over a regionwithin the image as a tactile input into a touch enabled device, wherethe input corresponding to the foreground portion of the image isrepresented in a first color (e.g., blue), while the input correspondingto the background portion of the image is represented as a second color(e.g., red).

In instances where the background stroke and foreground stroke intersectone another, a conflict can be detected. Responsive to detecting aconflict between a background stroke and a foreground stroke, the imagesegmentation system identifies a point of intersection of the conflict,and segments the background stroke and foreground stroke, and identifiesthe boundary of the object depicted by the image based on the segmentedbackground stroke and foreground stroke.

According to certain embodiments, responsive to generating the mediaitem based on the cropped object, the image segmentation system savesthe media item at a memory location associated with the client device,or a user account associated with the client device. For example, insome embodiments, the memory location may include a memory repository ofthe client device itself, while in further embodiments the memoryrepository may exist within a server system in communication with theclient device.

Having saved the media item at the memory location associated with theclient device, a user of the client device may access the media item ata later time. For example, the user may access a second image, select apoint within the second image, and overlay the media item at a positionbased on the point selected in the second image, to generate a secondmedia item. The user may distribute the second media item to one or moreusers through a message, such as an ephemeral message.

In some example embodiments, the image segmentation system may beimplemented as a virtualized application, such that a portion of theimage segmentation system is not installed at the client device. In suchembodiments, the image segmentation system replace a portion of aruntime environment executed by the client device with a virtualizationlayer, wherein the virtualization layer intercepts operations of theimage segmentation system and redirects them to a virtualized location.In this way, the client device may execute one or more of the operationsof the image segmentation system through accessing a virtual resource(instead of a physical resource of the client device).

In some embodiments, the image segmentation system may be implementedsuch that only essential portions of the image segmentation system areinstalled at the client device, and wherein code to execute the imagesegmentation system by the client device are delivered over the networkto the client device as and when they are needed. In such embodiments,the image segmentation system may be fully executed by the clientdevice, but may be stored at a centralized storage location remote fromthe client device.

In further embodiments, one or more of the functions and operationsperformed above are executed by a system external to the client deviceitself, such that a user of the client device may access and execute anapplication configured to perform the one or more functions performed bythe image segmentation through the client device.

FIG. 1 is a block diagram showing an example messaging system 100 forexchanging data (e.g., messages and associated content) over a network.The messaging system 100 includes one or more client device 102 whichhost a number of applications including a messaging client application104. Each messaging client application 104 is communicatively coupled toother instances of the messaging client application 104 and a messagingserver system 108 via a network 106 (e.g., the Internet).

Accordingly, each messaging client application 104 is able tocommunicate and exchange data with another messaging client application104 and with the messaging server system 108 via the network 106. Thedata exchanged between messaging client applications 104, and between amessaging client application 104 and the messaging server system 108,includes functions (e.g., commands to invoke functions) as well aspayload data (e.g., text, audio, video or other multimedia data).

The messaging server system 108 provides server-side functionality viathe network 106 to a particular messaging client application 104. Whilecertain functions of the messaging system 100 are described herein asbeing performed by either a messaging client application 104 or by themessaging server system 108, it will be appreciated that the location ofcertain functionality either within the messaging client application 104or the messaging server system 108 is a design choice. For example, itmay be technically preferable to initially deploy certain technology andfunctionality within the messaging server system 108, but to latermigrate this technology and functionality to the messaging clientapplication 104 where a client device 102 has a sufficient processingcapacity. Accordingly, in certain embodiments the image segmentationsystem 124 may be executed as a fully virtualized application, wherein aportion (but not necessarily all) of the image segmentation system 124is installed at the client device 102, while the remainder of the codeto execute the image segmentation system 124 is delivered to the clientdevice 102 via a browser executed by the client device 102, and throughthe network 106, as and when it is required. Thus, a user of the clientdevice 102 may execute the operations performed by the imagesegmentation system 124 through a browser, rather than installing theentirety of the image segmentation system 124 at the client device 102.

The messaging server system 108 supports various services and operationsthat are provided to the messaging client application 104. Suchoperations include transmitting data to, receiving data from, andprocessing data generated by the messaging client application 104. Insome embodiments, this data includes, message content, client deviceinformation, geolocation information, media annotation and overlays,message content persistence conditions, social network information, andlive event information, as examples. In other embodiments, other data isused. Data exchanges within the messaging system 100 are invoked andcontrolled through functions available via GUIs of the messaging clientapplication 104.

Turning now specifically to the messaging server system 108, anApplication Program Interface (API) server 110 is coupled to, andprovides a programmatic interface to, an application server 112. Theapplication server 112 is communicatively coupled to a database server118, which facilitates access to a database 120 in which is stored dataassociated with messages processed by the application server 112.

Dealing specifically with the Application Program Interface (API) server110, this server receives and transmits message data (e.g., commands andmessage payloads) between the client device 102 and the applicationserver 112. Specifically, the Application Program Interface (API) server110 provides a set of interfaces (e.g., routines and protocols) that canbe called or queried by the messaging client application 104 in order toinvoke functionality of the application server 112. The ApplicationProgram Interface (API) server 110 exposes various functions supportedby the application server 112, including account registration, loginfunctionality, the sending of messages, via the application server 112,from a particular messaging client application 104 to another messagingclient application 104, the sending of media files (e.g., images orvideo) from a messaging client application 104 to the messaging serverapplication 114, and for possible access by another messaging clientapplication 104, the setting of a collection of media data (e.g.,story), the retrieval of a list of friends of a user of a client device102, the retrieval of such collections, the retrieval of messages andcontent, the adding and deletion of friends to a social graph, thelocation of friends within a social graph, opening and application event(e.g., relating to the messaging client application 104).

The application server 112 hosts a number of applications andsubsystems, including a messaging server application 114, an imageprocessing system 116, a social network system 122, and an imagesegmentation system 124. The image segmentation system 124 is configuredto segment an image into foreground and background portions, and toidentify boundaries of objects depicted within the image to crop theobjects from the images and generate media items based on the croppedobjects, according to some example embodiments. Further details of theimage segmentation system 124 can be found in FIG. 3 below.

The messaging server application 114 implements a number of messageprocessing technologies and functions, particularly related to theaggregation and other processing of content (e.g., textual andmultimedia content) included in messages received from multipleinstances of the messaging client application 104. As will be describedin further detail, the text and media content from multiple sources maybe aggregated into collections of content (e.g., called stories orgalleries). These collections are then made available, by the messagingserver application 114, to the messaging client application 104. Otherprocessor and memory intensive processing of data may also be performedserver-side by the messaging server application 114, in view of thehardware requirements for such processing.

The application server 112 also includes an image processing system 116that is dedicated to performing various image processing operations,typically with respect to images or video received within the payload ofa message at the messaging server application 114.

The social network system 122 supports various social networkingfunctions services, and makes these functions and services available tothe messaging server application 114. To this end, the social networksystem 122 maintains and accesses an entity graph 304 within thedatabase 120. Examples of functions and services supported by the socialnetwork system 122 include the identification of other users of themessaging system 100 with which a particular user has relationships oris “following,” and also the identification of other entities andinterests of a particular user.

The application server 112 is communicatively coupled to a databaseserver 118, which facilitates access to a database 120 in which isstored data associated with messages processed by the messaging serverapplication 114.

FIG. 2 is block diagram illustrating further details regarding themessaging system 100, according to example embodiments. Specifically,the messaging system 100 is shown to comprise the messaging clientapplication 104 and the application server 112, which in turn embody anumber of some subsystems, namely an ephemeral timer system 202, acollection management system 204 and an annotation system 206.

The ephemeral timer system 202 is responsible for enforcing thetemporary access to content permitted by the messaging clientapplication 104 and the messaging server application 114. To this end,the ephemeral timer system 202 incorporates a number of timers that,based on duration and display parameters associated with a message,collection of messages (e.g., a SNAPCHAT story), or graphical element,selectively display and enable access to messages and associated contentvia the messaging client application 104. Further details regarding theoperation of the ephemeral timer system 202 are provided below.

The collection management system 204 is responsible for managingcollections of media (e.g., collections of text, image video and audiodata). In some examples, a collection of content (e.g., messages,including images, video, text and audio) may be organized into an “eventgallery” or an “event story.” Such a collection may be made availablefor a specified time period, such as the duration of an event to whichthe content relates. For example, content relating to a music concertmay be made available as a “story” for the duration of that musicconcert. The collection management system 204 may also be responsiblefor publishing an icon that provides notification of the existence of aparticular collection to the user interface of the messaging clientapplication 104.

The collection management system 204 furthermore includes a curationinterface 208 that allows a collection manager to manage and curate aparticular collection of content. For example, the curation interface208 enables an event organizer to curate a collection of contentrelating to a specific event (e.g., delete inappropriate content orredundant messages). Additionally, the collection management system 204employs machine vision (or image recognition technology) and contentrules to automatically curate a content collection. In certainembodiments, compensation may be paid to a user for inclusion of usergenerated content into a collection. In such cases, the curationinterface 208 operates to automatically make payments to such users forthe use of their content.

The annotation system 206 provides various functions that enable a userto annotate or otherwise modify or edit media content associated with amessage. For example, the annotation system 206 provides functionsrelated to the generation and publishing of media overlays for messagesprocessed by the messaging system 100. The annotation system 206operatively supplies a media overlay (e.g., a SNAPCHAT filter) to themessaging client application 104 based on a geolocation of the clientdevice 102. In another example, the annotation system 206 operativelysupplies a media overlay to the messaging client application 104 basedon other information, such as, social network information of the user ofthe client device 102. A media overlay may include audio and visualcontent and visual effects. Examples of audio and visual content includepictures, texts, logos, animations, and sound effects, as well asanimated facial models, such as those generated by the imagesegmentation system 124. An example of a visual effect includes coloroverlaying. The audio and visual content or the visual effects can beapplied to a media content item (e.g., a photo) at the client device102. For example, the media overlay including text that can be overlaidon top of a photograph generated taken by the client device 102. Inanother example, the media overlay includes an identification of alocation overlay (e.g., Venice beach), a name of a live event, or a nameof a merchant overlay (e.g., Beach Coffee House). In another example,the annotation system 206 uses the geolocation of the client device 102to identify a media overlay that includes the name of a merchant at thegeolocation of the client device 102. The media overlay may includeother indicia associated with the merchant. The media overlays may bestored in the database 120 and accessed through the database server 118.

In one example embodiment, the annotation system 206 provides auser-based publication platform that enables users to select ageolocation on a map, and upload content associated with the selectedgeolocation. The user may also specify circumstances under which aparticular media overlay should be offered to other users. Theannotation system 206 generates a media overlay that includes theuploaded content and associates the uploaded content with the selectedgeolocation.

In another example embodiment, the annotation system 206 provides amerchant-based publication platform that enables merchants to select aparticular media overlay associated with a geolocation via a biddingprocess. For example, the annotation system 206 associates the mediaoverlay of a highest bidding merchant with a corresponding geolocationfor a predefined amount of time

FIG. 3 is a block diagram illustrating components of the imagesegmentation system 124 that configure the image segmentation system 124to perform operations to detect crop objects from images based on alimited set of inputs received from a user through a graphical userinterface presented at a client device 102, according to some exampleembodiments.

The image segmentation system 124 is shown as including a presentationmodule 302, a media module 304, a segmentation module 306, and acommunication module 308, all configured to communicate with each other(e.g., via a bus, shared memory, or a switch). Any one or more of thesemodules may be implemented using one or more processors 310 (e.g., byconfiguring such one or more processors to perform functions describedfor that module) and hence may include one or more of the processors310.

Any one or more of the modules described may be implemented usinghardware alone (e.g., one or more of the processors 310 of a machine) ora combination of hardware and software. For example, any moduledescribed of the image segmentation system 124 may physically include anarrangement of one or more of the processors 310 (e.g., a subset of oramong the one or more processors of the machine) configured to performthe operations described herein for that module. As another example, anymodule of the image segmentation system 124 may include software,hardware, or both, that configure an arrangement of one or moreprocessors 310 (e.g., among the one or more processors of the machine)to perform the operations described herein for that module. Accordingly,different modules of the image segmentation system 124 may include andconfigure different arrangements of such processors 310 or a singlearrangement of such processors 310 at different points in time.Moreover, any two or more modules of the image segmentation system 124may be combined into a single module, and the functions described hereinfor a single module may be subdivided among multiple modules.Furthermore, according to various example embodiments, modules describedherein as being implemented within a single machine, database, or devicemay be distributed across multiple machines, databases, or devices.

According to certain example embodiments, one or more of the modules ofthe image segmentation system 124 may be accessed by the client device102 through a browser and executed by the client device 102 as avirtualized application through a virtualization layer executed at theclient device 102. The processors 310 may therefore include acombination of one or more processors of the client device 102 itself,and one or more processors executing at the application server 112.

FIG. 4 is a flowchart depicting a method 400 of segmenting an objectfrom an image, according to certain example embodiments. Operations ofthe method 400 may be performed by the modules described above withrespect to FIG. 3 . As shown in FIG. 4 , the method 400 includes one ormore operations 402, 404, 406, 408, 410, and 412.

At operation 402, the presentation module 302 causes display of an imagewithin a graphical user interface of a client device 102, wherein theimage comprises a set of image properties that define a foregroundportion of the image and a background portion of the image. For example,the image properties may be graphical properties of the image. The imagemay include a depiction of an object in the foreground or backgroundportion of the image.

In some embodiments, the presentation module 302 causes display of theimage at the client device 102 responsive to a request from the clientdevice 102 to display the image. For example, a user of the clientdevice 102 may provide an input that accesses the image from among animage repository (e.g., the database 120).

At operation 404, the presentation module 302 receives, from a user ofthe client device 102, a first input that selects or otherwiseidentifies a region within the foreground portion of the image via thegraphical user interface presented at the client device 102. Forexample, the input may comprise a stroking gesture, similar to a paintbrush, “painting” a region within the foreground portion of the imagepresented within the graphical user interface at the client device 102.

In some embodiments, the graphical user interface may include a menu toselect an input type. For example, the input types may include a firstinput type that enables a user to define foreground portions of animage, and a second input type that enables the user to define thebackground portions of the image. The user may provide an input into thegraphical user interface at the client device 102 to select an inputtype (e.g., the first input type), and then provide the first input toidentify the region within foreground portion of the image.

At operation 406, the presentation module 302 receives a second inputthat identifies the background portion of the image. As discussed abovewith respect top operation 404, the input may include a stroking gesturethat “paints” a portion of the image in order to identify the regionwithin the background portion of the image.

At operation 408, the segmentation module 306 identifies a boundary ofan object depicted in the image based on the first user input thatidentifies the foreground portion of the image and the second user inputthat identifies the background portion of the image, wherein theboundary comprises a set of dimensions.

In some embodiments, the identification of the boundary may be based ona progressive selection algorithm, wherein background and foregroundcolor information is estimated based on the selected portions of thebackground and foreground as defined by the first user input and thesecond user input. For example, the image segmentation system 124 mayfirst request that the user provides one or more inputs that identifythe foreground portion of the image, and responsive to receiving theinputs that identify the foreground portion of the image, request one ormore inputs to identify the background portion of the image.

For example, in some embodiments, responsive to receiving the firstinput that defines the foreground portion of the image, the segmentationmodule 306 randomly samples a number (e.g., 1200) pixels from theportion of the foreground defined by the first input. A color model ofthe foreground portion of the image is generated based on the pixelsrandomly selected from the portion of the foreground. A similar approachis applied to the background portion of the image, by randomly samplinga number of pixels from the portion defined by the second user input.

A multi-level graph cut based optimization is applied to the color modelof the foreground portion of the image and the color model of thebackground portion of the image in order to identify the boundary of theobject depicted in the image. In some embodiments, responsive toidentifying the boundary of the object based on the color models, thesegmentation module 306 causes display of a visual representation of theboundary of the object (e.g., an outline).

At operation 410, the segmentation module 306 crops the object from theimage based on the boundary of the object, and at operation 412generates a media item based on the cropped object, wherein the mediaitem comprises media properties (e.g., a size and shape) based on theset of dimensions of the boundary of the object.

In some example embodiments, the media item can then be saved to amemory location associated with the user of the client device 102. Forexample, the memory location may be a local memory of the client device102 or may also include the databases 120.

FIG. 5 is a flowchart depicting a method 500 segmenting an object froman image, according to certain example embodiments, and as depicted bythe flow-diagram 700 of FIG. 7 . Operations of the method 500 may beperformed by the modules described above with respect to FIG. 3 . Asshown in FIG. 5 , the method 500 includes one or more operations 502,504, 506, and 508.

At operation 502, the segmentation module 306 detects a conflict betweena first region of the image (as defined by the first user input todefine the foreground of the image), and the second region (as definedby the second user input to define the background of the image). Forexample, as seen in FIG. 7 , the conflict may include the overlap 730between the first region 720 and the second region 735, wherein theoverlap 730 comprises an intersection at a point within the image 755.

At operation 504, the segmentation module 306 segments the first region(e.g., the first region 720 of FIG. 7 ) into at least a first segment(e.g., the first segment 750 of FIG. 7 ) at the point of theintersection, wherein the first segment comprises at least a portion ofthe first region. Responsive to segmenting the first region into thefirst segment, in some embodiments the segmentation module 306 takes arandom sampling of pixels within the first segment in order to generatea color model of the foreground of the image.

Similarly, at operation 506, the segmentation module 306 segments thesecond region into at least a second segment at the point of theintersection, wherein the second segment comprises at least a portion ofthe second region. Responsive to segmenting the second region into thesecond segment, the segmentation module 306 takes a random sampling ofpixels within the second segment in order to generate a color model ofthe background of the image.

At operation 508, the segmentation module 306 identifies the boundary ofthe object depicted based on the first and second segments of theregions defined by the first and second inputs.

FIG. 6 is a flowchart depicting a method 600 generating media content,according to certain example embodiments, and as depicted by theflow-diagram 800 of FIG. 8 . Operations of the method 600 may beperformed by the modules described above with respect to FIG. 3 . Asshown in FIG. 6 , the method 600 includes one or more operations 602,604, and 606.

At operation 602, the media module 302 accesses a second image at theclient device 102. For example, in some embodiments, a user of theclient device 102 may provide one or more input identifying, generating,or otherwise selecting a second image (e.g., the second image 815depicted in FIG. 8 ).

At operation 604, the media module 304 receives an input that identifiesa point within the second image. Responsive to receiving the input thatidentifies the point within the second image, at operation 606 the mediamodule 304 positions a presentation of the media item generated inoperation 410 of the method 400 (e.g., the media item 820 of FIG. 8 ) atthe point identified by the user input within the second image.

FIG. 7 is a flow-diagram 700 depicting a method to segment an objectfrom an image, according to certain example embodiments. As seen in FIG.7 , the flow-diagram 700 includes an image 755, a foreground region 720of the image 755, defined by a first user input, and background region735 of the image 755 defined by a second user input, as described in themethods 400 and 500 of FIGS. 4 and 5 . Operations depicted by theflow-diagram 700 may be performed by the modules described above withrespect to FIG. 3 .

At operation 705, as discussed in operation 404 of the method 400depicted in FIG. 4 , a user provides a first input that defines a region720 of the image 755. For example, the user may provide an input bydragging a cursor (or in the case of a touch-screen device, a tactileinput dragging a finger or stylus) along a region as depicted by theforeground region 720 in FIG. 7 . Responsive to receiving the input, theimage segmentation system 124 causes display of a visual representationof the foreground region 720, such as the “scribble” seen in FIG. 7 .

In some embodiments, responsive to receiving the input that identifiesthe foreground region 720, the segmentation module 306 performsoperations that include sampling a random set of pixels within theforeground region 720, generating a color model that represent theforeground region 720, and identifies a boundary 725 of an objectdepicted in the image 755 based on the color model. The imagesegmentation system 124 may cause display of a visualization of theboundary 725. As seen in FIG. 7 , the boundary 725 is represented as adotted line.

At operation 710, responsive to receiving a user input that defines thebackground region 735, as described in operation 502 of the method 500,the segmentation module 306 detects the conflict 730 between theforeground region 720 and the background region 735, wherein theconflict 730 comprises an overlap between the foreground region 720 andthe background region 735.

As described in operation 504 and 506 of the method 500, thesegmentation module 306 segments the first region 720 into at least afirst segment 750 at the point of the conflict 730, and segments thesecond region 735 into at least a second segment 740 at the point of theconflict 730. For example, as seen in operation 715 of FIG. 7 , theoverlapping portions of the foreground region 720 and the backgroundregion 735 are removed, such that the segmentation module 306 mayre-sample a random set of pixels from within the first segment 750 andthe second segment 740 in order to generate color models to identify theboundary.

As seen in operation 715, responsive to segmenting the foreground andbackground regions into the first segment 750 and the second segment740, the segmentation module 306 applies the updated color models toidentify the boundary 745.

FIG. 8 is a flow-diagram 800 depicting a method of generating mediacontent, according to certain example embodiments. As seen in FIG. 8 ,the flow-diagram 800 includes a first image 805, an input 810 onto thefirst image 805, a media item 820, a second image 815, and a secondmedia item 825, wherein the second media item 825 is generated based onthe second image 815 and the media item 820.

As discussed in the method 600 of FIG. 6 above, the image segmentationsystem 124 detects the boundary of the object depicted in the image 805based on the input 810. For example, the input 810 may define a regionwithin the image 805 that corresponds with a foreground portion of theimage 805.

Responsive to receiving the input 810, the image segmentation system 124takes a random sampling of pixels within the region defined by the input810 and generates a color model that represents the foreground portionof the image. Based on the color model, the image segmentation system124 identifies the boundary of the object depicted in the image 805 andsegments the object from the image 805 to generate the media item 820.

In some embodiments, responsive to generating the media item 820, theimage segmentation system 124 stores the media item 820 at a memorylocation associated with a user of the client device (e.g., the database120), such that the user may access the media item 820 at a later time.

As discussed in operation 602 of the method 600, a user of the clientdevice 102 may access and cause display of a second image 815 at theclient device 102, and provide an input 830 that selects a point withinthe second image 815.

Responsive to receiving the input 830 that selects the point within thesecond image 815, the media module 304 may retrieve the media item 820,and generate the second media item 825, by overlaying the media item 820at a position within the image 815 based on the point selected by theinput 830.

According to certain embodiments, the user of the client device 102 maythen generate a message, such as an ephemeral message, to be distributedto one or more recipients, and which includes the second media item 825.

Software Architecture

FIG. 9 is a block diagram illustrating an example software architecture906, which may be used in conjunction with various hardwarearchitectures herein described. FIG. 9 is a non-limiting example of asoftware architecture and it will be appreciated that many otherarchitectures may be implemented to facilitate the functionalitydescribed herein. The software architecture 906 may execute on hardwaresuch as machine 1000 of FIG. 10 that includes, among other things,processors 1004, memory 1014, and I/O components 1018. A representativehardware layer 952 is illustrated and can represent, for example, themachine 1000 of FIG. 10 . The representative hardware layer 952 includesa processing unit 954 having associated executable instructions 904.Executable instructions 904 represent the executable instructions of thesoftware architecture 906, including implementation of the methods,components and so forth described herein. The hardware layer 952 alsoincludes memory and/or storage modules memory/storage 956, which alsohave executable instructions 904. The hardware layer 952 may alsocomprise other hardware 958.

In the example architecture of FIG. 9 , the software architecture 906may be conceptualized as a stack of layers where each layer providesparticular functionality. For example, the software architecture 906 mayinclude layers such as an operating system 902, libraries 920,applications 916 and a presentation layer 914. Operationally, theapplications 916 and/or other components within the layers may invokeapplication programming interface (API) API calls 908 through thesoftware stack and receive a response as in response to the API calls908. The layers illustrated are representative in nature and not allsoftware architectures have all layers. For example, some mobile orspecial purpose operating systems may not provide aframeworks/middleware 918, while others may provide such a layer. Othersoftware architectures may include additional or different layers.

The operating system 902 may manage hardware resources and providecommon services. The operating system 902 may include, for example, akernel 922, services 924 and drivers 926. The kernel 922 may act as anabstraction layer between the hardware and the other software layers.For example, the kernel 922 may be responsible for memory management,processor management (e.g., scheduling), component management,networking, security settings, and so on. The services 924 may provideother common services for the other software layers. The drivers 926 areresponsible for controlling or interfacing with the underlying hardware.For instance, the drivers 926 include display drivers, camera drivers,Bluetooth® drivers, flash memory drivers, serial communication drivers(e.g., Universal Serial Bus (USB) drivers), Wi-Fi® drivers, audiodrivers, power management drivers, and so forth depending on thehardware configuration.

The libraries 920 provide a common infrastructure that is used by theapplications 916 and/or other components and/or layers. The libraries920 provide functionality that allows other software components toperform tasks in an easier fashion than to interface directly with theunderlying operating system 902 functionality (e.g., kernel 922,services 924 and/or drivers 926). The libraries 920 may include systemlibraries 944 (e.g., C standard library) that may provide functions suchas memory allocation functions, string manipulation functions,mathematical functions, and the like. In addition, the libraries 920 mayinclude API libraries 946 such as media libraries (e.g., libraries tosupport presentation and manipulation of various media format such asMPREG4, H.264, MP3, AAC, AMR, JPG, PNG), graphics libraries (e.g., anOpenGL framework that may be used to render 2D and 3D in a graphiccontent on a display), database libraries (e.g., SQLite that may providevarious relational database functions), web libraries (e.g., WebKit thatmay provide web browsing functionality), and the like. The libraries 920may also include a wide variety of other libraries 948 to provide manyother APIs to the applications 916 and other softwarecomponents/modules.

The frameworks/middleware 918 (also sometimes referred to as middleware)provide a higher-level common infrastructure that may be used by theapplications 916 and/or other software components/modules. For example,the frameworks/middleware 918 may provide various graphic user interface(GUI) functions, high-level resource management, high-level locationservices, and so forth. The frameworks/middleware 918 may provide abroad spectrum of other APIs that may be utilized by the applications916 and/or other software components/modules, some of which may bespecific to a particular operating system 902 or platform.

The applications 916 include built-in applications 938 and/orthird-party applications 940. Examples of representative built-inapplications 938 may include, but are not limited to, a contactsapplication, a browser application, a book reader application, alocation application, a media application, a messaging application,and/or a game application. Third-party applications 940 may include anapplication developed using the ANDROID™ or IOS™ software developmentkit (SDK) by an entity other than the vendor of the particular platform,and may be mobile software running on a mobile operating system such asIOS™, ANDROID™, WINDOWS® Phone, or other mobile operating systems. Thethird-party applications 940 may invoke the API calls 908 provided bythe mobile operating system (such as operating system 902) to facilitatefunctionality described herein.

The applications 916 may use built in operating system functions (e.g.,kernel 922, services 924 and/or drivers 926), libraries 920, andframeworks/middleware 918 to create user interfaces to interact withusers of the system. Alternatively, or additionally, in some systemsinteractions with a user may occur through a presentation layer, such aspresentation layer 914. In these systems, the application/component“logic” can be separated from the aspects of the application/componentthat interact with a user.

FIG. 10 is a block diagram illustrating components of a machine 1000,according to some example embodiments, able to read instructions from amachine-readable medium (e.g., a machine-readable storage medium) andperform any one or more of the methodologies discussed herein.Specifically, FIG. 10 shows a diagrammatic representation of the machine1000 in the example form of a computer system, within which instructions1010(e.g., software, a program, an application, an applet, an app, orother executable code) for causing the machine 1000 to perform any oneor more of the methodologies discussed herein may be executed. As such,the instructions 1010 may be used to implement modules or componentsdescribed herein. The instructions 1010 transform the general,non-programmed machine 1000 into a particular machine 1000 programmed tocarry out the described and illustrated functions in the mannerdescribed. In alternative embodiments, the machine 1000 operates as astandalone device or may be coupled (e.g., networked) to other machines.In a networked deployment, the machine 1000 may operate in the capacityof a server machine or a client machine in a server-client networkenvironment, or as a peer machine in a peer-to-peer (or distributed)network environment. The machine 1000 may comprise, but not be limitedto, a server computer, a client computer, a personal computer (PC), atablet computer, a laptop computer, a netbook, a set-top box (STB), apersonal digital assistant (PDA), an entertainment media system, acellular telephone, a smart phone, a mobile device, a wearable device(e.g., a smart watch), a smart home device (e.g., a smart appliance),other smart devices, a web appliance, a network router, a networkswitch, a network bridge, or any machine capable of executing theinstructions 1010, sequentially or otherwise, that specify actions to betaken by machine 1000. Further, while only a single machine 1000 isillustrated, the term “machine” shall also be taken to include acollection of machines that individually or jointly execute theinstructions 1010 to perform any one or more of the methodologiesdiscussed herein.

The machine 1000 may include processors 1004, memory memory/storage1006, and I/O components 1018, which may be configured to communicatewith each other such as via a bus 1002. The memory/storage 1006 mayinclude a memory 1014, such as a main memory, or other memory storage,and a storage unit 1016, both accessible to the processors 1004 such asvia the bus 1002. The storage unit 1016 and memory 1014 store theinstructions 1010 embodying any one or more of the methodologies orfunctions described herein. The instructions 1010 may also reside,completely or partially, within the memory 1014, within the storage unit1016, within at least one of the processors 1004 (e.g., within theprocessor’s cache memory), or any suitable combination thereof, duringexecution thereof by the machine 1000. Accordingly, the memory 1014, thestorage unit 1016, and the memory of processors 1004 are examples ofmachine-readable media.

The I/O components 1018 may include a wide variety of components toreceive input, provide output, produce output, transmit information,exchange information, capture measurements, and so on. The specific I/Ocomponents 1018 that are included in a particular machine 1000 willdepend on the type of machine. For example, portable machines such asmobile phones will likely include a touch input device or other suchinput mechanisms, while a headless server machine will likely notinclude such a touch input device. It will be appreciated that the I/Ocomponents 1018 may include many other components that are not shown inFIG. 10 . The I/O components 1018 are grouped according to functionalitymerely for simplifying the following discussion and the grouping is inno way limiting. In various example embodiments, the I/O components 1018may include output components 1026 and input components 1028. The outputcomponents 1026 may include visual components (e.g., a display such as aplasma display panel (PDP), a light emitting diode (LED) display, aliquid crystal display (LCD), a projector, or a cathode ray tube (CRT)),acoustic components (e.g., speakers), haptic components (e.g., avibratory motor, resistance mechanisms), other signal generators, and soforth. The input components 1028 may include alphanumeric inputcomponents (e.g., a keyboard, a touch screen configured to receivealphanumeric input, a photo-optical keyboard, or other alphanumericinput components), point based input components (e.g., a mouse, atouchpad, a trackball, a joystick, a motion sensor, or other pointinginstrument), tactile input components (e.g., a physical button, a touchscreen that provides location and/or force of touches or touch gestures,or other tactile input components), audio input components (e.g., amicrophone), and the like.

In further example embodiments, the I/O components 1018 may includebiometric components 1030, motion components 1034, environmentalenvironment components 1036, or position components 1038 among a widearray of other components. For example, the biometric components 1030may include components to detect expressions (e.g., hand expressions,facial expressions, vocal expressions, body gestures, or eye tracking),measure biosignals (e.g., blood pressure, heart rate, body temperature,perspiration, or brain waves), identify a person (e.g., voiceidentification, retinal identification, facial identification,fingerprint identification, or electroencephalogram basedidentification), and the like. The motion components 1034 may includeacceleration sensor components (e.g., accelerometer), gravitation sensorcomponents, rotation sensor components (e.g., gyroscope), and so forth.The environment components 1036 may include, for example, illuminationsensor components (e.g., photometer), temperature sensor components(e.g., one or more thermometer that detect ambient temperature),humidity sensor components, pressure sensor components (e.g.,barometer), acoustic sensor components (e.g., one or more microphonesthat detect background noise), proximity sensor components (e.g.,infrared sensors that detect nearby objects), gas sensors (e.g., gasdetection sensors to detection concentrations of hazardous gases forsafety or to measure pollutants in the atmosphere), or other componentsthat may provide indications, measurements, or signals corresponding toa surrounding physical environment. The position components 1038 mayinclude location sensor components (e.g., a Global Position system (GPS)receiver component), altitude sensor components (e.g., altimeters orbarometers that detect air pressure from which altitude may be derived),orientation sensor components (e.g., magnetometers), and the like.

Communication may be implemented using a wide variety of technologies.The I/O components 1018 may include communication components 1040operable to couple the machine 1000 to a network 1032 or devices 1020via coupling 1022 and coupling 1024 respectively. For example, thecommunication components 1040 may include a network interface componentor other suitable device to interface with the network 1032. In furtherexamples, communication components 1040 may include wired communicationcomponents, wireless communication components, cellular communicationcomponents, Near Field Communication (NFC) components, Bluetooth®components (e.g., Bluetooth® Low Energy), Wi-Fi® components, and othercommunication components to provide communication via other modalities.The devices 1020 may be another machine or any of a wide variety ofperipheral devices (e.g., a peripheral device coupled via a UniversalSerial Bus (USB)).

Moreover, the communication components 1040 may detect identifiers orinclude components operable to detect identifiers. For example, thecommunication components 1040 may include Radio Frequency Identification(RFID) tag reader components, NFC smart tag detection components,optical reader components (e.g., an optical sensor to detectone-dimensional bar codes such as Universal Product Code (UPC) bar code,multi-dimensional bar codes such as Quick Response (QR) code, Azteccode, Data Matrix, Dataglyph, MaxiCode, PDF417, Ultra Code, UCC RSS-2Dbar code, and other optical codes), or acoustic detection components(e.g., microphones to identify tagged audio signals). In addition, avariety of information may be derived via the communication components1040, such as, location via Internet Protocol (IP) geo-location,location via Wi-Fi® signal triangulation, location via detecting a NFCbeacon signal that may indicate a particular location, and so forth.

Glossary

“CARRIER SIGNAL” in this context refers to any intangible medium that iscapable of storing, encoding, or carrying instructions for execution bythe machine, and includes digital or analog communications signals orother intangible medium to facilitate communication of suchinstructions. Instructions may be transmitted or received over thenetwork using a transmission medium via a network interface device andusing any one of a number of well-known transfer protocols.

“CLIENT DEVICE” in this context refers to any machine that interfaces toa communications network to obtain resources from one or more serversystems or other client devices. A client device may be, but is notlimited to, a mobile phone, desktop computer, laptop, portable digitalassistants (PDAs), smart phones, tablets, ultra books, netbooks,laptops, multi-processor systems, microprocessor-based or programmableconsumer electronics, game consoles, set-top boxes, or any othercommunication device that a user may use to access a network.

“COMMUNICATIONS NETWORK” in this context refers to one or more portionsof a network that may be an ad hoc network, an intranet, an extranet, avirtual private network (VPN), a local area network (LAN), a wirelessLAN (WLAN), a wide area network (WAN), a wireless WAN (WWAN), ametropolitan area network (MAN), the Internet, a portion of theInternet, a portion of the Public Switched Telephone Network (PSTN), aplain old telephone service (POTS) network, a cellular telephonenetwork, a wireless network, a Wi-Fi® network, another type of network,or a combination of two or more such networks. For example, a network ora portion of a network may include a wireless or cellular network andthe coupling may be a Code Division Multiple Access (CDMA) connection, aGlobal System for Mobile communications (GSM) connection, or other typeof cellular or wireless coupling. In this example, the coupling mayimplement any of a variety of types of data transfer technology, such asSingle Carrier Radio Transmission Technology (1xRTT), Evolution-DataOptimized (EVDO) technology, General Packet Radio Service (GPRS)technology, Enhanced Data rates for GSM Evolution (EDGE) technology,third Generation Partnership Project (3GPP) including 3G, fourthgeneration wireless (4G) networks, Universal Mobile TelecommunicationsSystem (UMTS), High Speed Packet Access (HSPA), WorldwideInteroperability for Microwave Access (WiMAX), Long Term Evolution (LTE)standard, others defined by various standard setting organizations,other long range protocols, or other data transfer technology.

“EMPHEMERAL MESSAGE” in this context refers to a message that isaccessible for a time-limited duration. An ephemeral message may be atext, an image, a video and the like. The access time for the ephemeralmessage may be set by the message sender. Alternatively, the access timemay be a default setting or a setting specified by the recipient.Regardless of the setting technique, the message is transitory.

“MACHINE-READABLE MEDIUM” in this context refers to a component, deviceor other tangible media able to store instructions and data temporarilyor permanently and may include, but is not be limited to, random-accessmemory (RAM), read-only memory (ROM), buffer memory, flash memory,optical media, magnetic media, cache memory, other types of storage(e.g., Erasable Programmable Read-Only Memory (EEPROM)) and/or anysuitable combination thereof. The term “machine-readable medium” shouldbe taken to include a single medium or multiple media (e.g., acentralized or distributed database, or associated caches and servers)able to store instructions. The term “machine-readable medium” shallalso be taken to include any medium, or combination of multiple media,that is capable of storing instructions (e.g., code) for execution by amachine, such that the instructions, when executed by one or moreprocessors of the machine, cause the machine to perform any one or moreof the methodologies described herein. Accordingly, a “machine-readablemedium” refers to a single storage apparatus or device, as well as“cloud-based” storage systems or storage networks that include multiplestorage apparatus or devices. The term “machine-readable medium”excludes signals per se.

“COMPONENT” in this context refers to a device, physical entity or logichaving boundaries defined by function or subroutine calls, branchpoints, application program interfaces (APIs), or other technologiesthat provide for the partitioning or modularization of particularprocessing or control functions. Components may be combined via theirinterfaces with other components to carry out a machine process. Acomponent may be a packaged functional hardware unit designed for usewith other components and a part of a program that usually performs aparticular function of related functions. Components may constituteeither software components (e.g., code embodied on a machine-readablemedium) or hardware components. A “hardware component” is a tangibleunit capable of performing certain operations and may be configured orarranged in a certain physical manner. In various example embodiments,one or more computer systems (e.g., a standalone computer system, aclient computer system, or a server computer system) or one or morehardware components of a computer system (e.g., a processor or a groupof processors) may be configured by software (e.g., an application orapplication portion) as a hardware component that operates to performcertain operations as described herein. A hardware component may also beimplemented mechanically, electronically, or any suitable combinationthereof. For example, a hardware component may include dedicatedcircuitry or logic that is permanently configured to perform certainoperations. A hardware component may be a special-purpose processor,such as a Field-Programmable Gate Array (FPGA) or an ApplicationSpecific Integrated Circuit (ASIC). A hardware component may alsoinclude programmable logic or circuitry that is temporarily configuredby software to perform certain operations. For example, a hardwarecomponent may include software executed by a general-purpose processoror other programmable processor. Once configured by such software,hardware components become specific machines (or specific components ofa machine) uniquely tailored to perform the configured functions and areno longer general-purpose processors. It will be appreciated that thedecision to implement a hardware component mechanically, in dedicatedand permanently configured circuitry, or in temporarily configuredcircuitry (e.g., configured by software) may be driven by cost and timeconsiderations. Accordingly, the phrase “hardware component″(or“hardware-implemented component”) should be understood to encompass atangible entity, be that an entity that is physically constructed,permanently configured (e.g., hardwired), or temporarily configured(e.g., programmed) to operate in a certain manner or to perform certainoperations described herein. Considering embodiments in which hardwarecomponents are temporarily configured (e.g., programmed), each of thehardware components need not be configured or instantiated at any oneinstance in time. For example, where a hardware component comprises ageneral-purpose processor configured by software to become aspecial-purpose processor, the general-purpose processor may beconfigured as respectively different special-purpose processors (e.g.,comprising different hardware components) at different times. Softwareaccordingly configures a particular processor or processors, forexample, to constitute a particular hardware component at one instanceof time and to constitute a different hardware component at a differentinstance of time. Hardware components can provide information to, andreceive information from, other hardware components. Accordingly, thedescribed hardware components may be regarded as being communicativelycoupled. Where multiple hardware components exist contemporaneously,communications may be achieved through signal transmission (e.g., overappropriate circuits and buses) between or among two or more of thehardware components. In embodiments in which multiple hardwarecomponents are configured or instantiated at different times,communications between such hardware components may be achieved, forexample, through the storage and retrieval of information in memorystructures to which the multiple hardware components have access. Forexample, one hardware component may perform an operation and store theoutput of that operation in a memory device to which it iscommunicatively coupled. A further hardware component may then, at alater time, access the memory device to retrieve and process the storedoutput. Hardware components may also initiate communications with inputor output devices, and can operate on a resource (e.g., a collection ofinformation). The various operations of example methods described hereinmay be performed, at least partially, by one or more processors that aretemporarily configured (e.g., by software) or permanently configured toperform the relevant operations. Whether temporarily or permanentlyconfigured, such processors may constitute processor-implementedcomponents that operate to perform one or more operations or functionsdescribed herein. As used herein, “processor-implemented component”refers to a hardware component implemented using one or more processors.Similarly, the methods described herein may be at least partiallyprocessor-implemented, with a particular processor or processors beingan example of hardware. For example, at least some of the operations ofa method may be performed by one or more processors orprocessor-implemented components. Moreover, the one or more processorsmay also operate to support performance of the relevant operations in a“cloud computing” environment or as a “software as a service” (SaaS).For example, at least some of the operations may be performed by a groupof computers (as examples of machines including processors), with theseoperations being accessible via a network (e.g., the Internet) and viaone or more appropriate interfaces (e.g., an Application ProgramInterface (API)). The performance of certain of the operations may bedistributed among the processors, not only residing within a singlemachine, but deployed across a number of machines. In some exampleembodiments, the processors or processor-implemented components may belocated in a single geographic location (e.g., within a homeenvironment, an office environment, or a server farm). In other exampleembodiments, the processors or processor-implemented components may bedistributed across a number of geographic locations.

“PROCESSOR” in this context refers to any circuit or virtual circuit (aphysical circuit emulated by logic executing on an actual processor)that manipulates data values according to control signals (e.g.,“commands”, “op codes”, “machine code”, etc. ) and which producescorresponding output signals that are applied to operate a machine. Aprocessor may, for example, be a Central Processing Unit (CPU), aReduced Instruction Set Computing (RISC) processor, a ComplexInstruction Set Computing (CISC) processor, a Graphics Processing Unit(GPU), a Digital Signal Processor (DSP), an Application SpecificIntegrated Circuit (ASIC), a Radio-Frequency Integrated Circuit (RFIC)or any combination thereof. A processor may further be a multi-coreprocessor having two or more independent processors (sometimes referredto as “cores”) that may execute instructions contemporaneously.

“TIMESTAMP” in this context refers to a sequence of characters orencoded information identifying when a certain event occurred, forexample giving date and time of day, sometimes accurate to a smallfraction of a second.

“LIFT” in this context is a measure of the performance of a targetedmodel at predicting or classifying cases as having an enhanced response(with respect to a population as a whole), measured against a randomchoice targeting model.

“PHONEME ALIGNMENT” in this context, a phoneme is a unit of speech thatdifferentiates one word from another. One phoneme may consist of asequence of closure, burst, and aspiration events; or, a dipthong maytransition from a back vowel to a front vowel. A speech signal maytherefore be described not only by what phonemes it contains, but alsothe locations of the phonemes. Phoneme alignment may therefore bedescribed as a “time-alignment” of phonemes in a waveform, in order todetermine an appropriate sequence and location of each phoneme in aspeech signal.

“AUDIO-TO-VISUAL CONVERSION” in this context refers to the conversion ofaudible speech signals into visible speech, wherein the visible speechmay include a mouth shape representative of the audible speech signal.

“TIME DELAYED NEURAL NETWORK (TDNN)” in this context, a TDNN is anartificial neural network architecture whose primary purpose is to workon sequential data. An example would be converting continuous audio intoa stream of classified phoneme labels for speech recognition.

“BI-DIRECTIONAL LONG-SHORT TERM MEMORY (BLSTM)” in this context refersto a recurrent neural network (RNN) architecture that remembers valuesover arbitrary intervals. Stored values are not modified as learningproceeds. RNNs allow forward and backward connections between neurons.BLSTM are well-suited for the classification, processing, and predictionof time series, given time lags of unknown size and duration betweenevents.

What is claimed is:
 1. A method comprising: causing display of an imagewithin a graphical user interface at a client device, the imagecomprising a display of an object depicted within a foreground of theimage; receiving an input that identifies the foreground of the image;identifying a boundary of the display of the object depicted within theforeground of the image based on the input that identifies theforeground of the image; cropping the object from the image based on theboundary of the object; and generating a media object based on theobject, the media object comprising a shape based on the boundary of theobject.
 2. The method of claim 1, further comprising: saving the mediaobject at a memory location associated with a user of the client device.3. The method of claim 1, wherein the image is a first image, and themethod further comprises: causing display of a second image at theclient device; receiving a tactile input that identifies a positionwithin the second image; and presenting the media object at the positionwithin the second image based on the tactile input that identifies theposition within the second image.
 4. The method of claim 3, furthercomprising: generating a message that includes the second image thatincludes the media object at the position within the second image. 5.The method of claim 1, wherein the receiving the input that identifiesthe foreground of the image includes: receiving the input comprises anidentification of a set of pixels from within the foreground portion ofthe image; generating a color model of the set of pixels; andidentifying the foreground of the image based on the color model.
 6. Themethod of claim 1, wherein the input that identifies the foreground ofthe image comprises a tactile input that draws a line over theforeground of the image.
 7. The method of claim 1, wherein the inputthat identifies the foreground of the image comprises a first input thatidentifies a first set of pixels within the foreground of the image anda second input that identifies a second set of pixels within abackground of the image, and the identifying the boundary of the displayof the object includes: generating a first color model that representsthe foreground portion of the image based on the first set of pixels;generating a second color model that represents the background portionof the image based on the second set of pixels; and identifying theboundary of the object depicted in the images based on the first colormodel and the second color model.
 8. A system comprising: a memory; andat least one hardware processor coupled to the memory and comprisinginstructions that causes the system to perform operations comprising:causing display of an image within a graphical user interface at aclient device, the image comprising a display of an object depictedwithin a foreground of the image; receiving an input that identifies theforeground of the image; identifying a boundary of the display of theobject depicted within the foreground of the image based on the inputthat identifies the foreground of the image; cropping the object fromthe image based on the boundary of the object; and generating a mediaobject based on the object, the media object comprising a shape based onthe boundary of the object.
 9. The system of claim 8, furthercomprising: saving the media object at a memory location associated witha user of the client device.
 10. The system of claim 8, wherein theimage is a first image, and the method further comprises: causingdisplay of a second image at the client device; receiving a tactileinput that identifies a position within the second image; and presentingthe media object at the position within the second image based on thetactile input that identifies the position within the second image. 11.The system of claim 10, further comprising: generating a message thatincludes the second image that includes the media object at the positionwithin the second image.
 12. The system of claim 8, wherein thereceiving the input that identifies the foreground of the imageincludes: receiving the input comprises an identification of a set ofpixels from within the foreground portion of the image; generating acolor model of the set of pixels; and identifying the foreground of theimage based on the color model.
 13. The system of claim 8, wherein theinput that identifies the foreground of the image comprises a tactileinput that draws a line over the foreground of the image.
 14. The systemof claim 8, wherein the input that identifies the foreground of theimage comprises a first input that identifies a first set of pixelswithin the foreground of the image and a second input that identifies asecond set of pixels within a background of the image, and theidentifying the boundary of the display of the object includes:generating a first color model that represents the foreground portion ofthe image based on the first set of pixels; generating a second colormodel that represents the background portion of the image based on thesecond set of pixels; and identifying the boundary of the objectdepicted in the images based on the first color model and the secondcolor model.
 15. A non-transitory machine-readable storage mediumcomprising instructions that, when executed by one or more processors ofa machine, cause the machine to perform operations comprising: causingdisplay of an image within a graphical user interface at a clientdevice, the image comprising a display of an object depicted within aforeground of the image; receiving an input that identifies theforeground of the image; identifying a boundary of the display of theobject depicted within the foreground of the image based on the inputthat identifies the foreground of the image; cropping the object fromthe image based on the boundary of the object; and generating a mediaobject based on the object, the media object comprising a shape based onthe boundary of the object.
 16. The non-transitory machine-readablestorage medium of claim 15, further comprising: saving the media objectat a memory location associated with a user of the client device. 17.The non-transitory machine-readable storage medium of claim 15, whereinthe image is a first image, and the method further comprises: causingdisplay of a second image at the client device; receiving a tactileinput that identifies a position within the second image; and presentingthe media object at the position within the second image based on thetactile input that identifies the position within the second image. 18.The non-transitory machine-readable storage medium of claim 17, furthercomprising: generating a message that includes the second image thatincludes the media object at the position within the second image. 19.The non-transitory machine-readable storage medium of claim 15, whereinthe receiving the input that identifies the foreground of the imageincludes: receiving the input comprises an identification of a set ofpixels from within the foreground portion of the image; generating acolor model of the set of pixels; and identifying the foreground of theimage based on the color model.
 20. The non-transitory machine-readablestorage medium of claim 15, wherein the input that identifies theforeground of the image comprises a tactile input that draws a line overthe foreground of the image.